package com.whys;

public class OverloadDemo {

    // 重载  方法名一样 参数不一样
    public void getName(){
        System.out.println("获取名字");
    }

    public void getName(String name){
        System.out.println("获取名字"+name);
    }

    public void getName(String name,String gender){
        System.out.println("获取名字"+name+"性别"+gender);
    }

    public static void main(String[] args) {
        OverloadDemo overloadDemo = new OverloadDemo();
        overloadDemo.getName();
        overloadDemo.getName("张三");
        overloadDemo.getName("张三","男");

    }
}
